import dayjs from 'dayjs';
import { downLoad, request } from '../../../request';

/** 新增通孔架 */
export function addThroughHoleFrame(data: any) {
  return request({
    url: '/qms/through/throughHoleFrame/insert',
    method: 'post',
    data
  });
}

/** 修改通孔架 */
export function updateThroughHoleFrame(data: any) {
  return request({
    url: '/qms/through/throughHoleFrame/update',
    method: 'post',
    data
  });
}

/** 删除通孔架 */
export function deleteThroughHoleFrame(id: any) {
  return request({
    url: `/qms/through/throughHoleFrame/delete?id=${id}`,
    method: 'delete'
  });
}

/** 导出通孔架 */
export function exportThroughHoleFrame(params: any) {
  return downLoad({
    url: '/qms/through/throughHoleFrame/export',
    params,
    method: 'get',
    fileName: `通孔架管理员导出${dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`
  });
}

/** 通孔架报废 */
export function scrapThroughHoleFrame(data: any) {
  return request({
    url: `/qms/through/throughHoleFrame/scrap`,
    method: 'post',
    data
  });
}
